-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(v2): remove Markdown syntax from excerpt #2701
Conversation
Deploy preview for docusaurus-2 ready! Built with commit 3ec542d |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Have you considered using https://github.com/remarkjs/strip-markdown instead? It's based on remark
while remove-markdown
uses regex.
Ok, I used Remark for these purposes, but I noticed that there was a slight decrease in performance compared to the previous solution that uses regular expressions. I commented lines related to the previous solution so that you can see for yourself which option is better. UPD: Moreover, we do not need to use a third-party "remove-markdown" package as ready-made solution that removes MD via regular expressions, since there are many |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not understand which of the solutions we use in the end? |
cc @yangshun |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which do you recommend?
Personally, I like a solution using regular expressions. We can opt out of using the npm strip-markdown package, and instead choose the regexps we really need to solve current issue. |
Ok let's do your way then. Introducing a perf regression for this isn't really worth it. |
Done ✔️ Time building on my laptop: Probably not bad, although I think we need a more accurate way to comparing than just starting the building website with a cleared cache. |
Motivation
Resolve #2607
Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
See preview and tests.
Related PRs
(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)